package com.tripler.eurekademoclient.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @title: ConsumerController
 * @projectName: eureka-demo-client
 * @description: TODO
 * @author: Zoran
 * @dateTime: 2019/7/17 22:45
 */
@RestController
public class ConsumerController {

    @Autowired
    RestTemplate restTemplate;

    @GetMapping("/ribbon-consumer")
    public String helloConsumer() {
        return restTemplate.getForEntity("http://EUREKADEMOSERVICE/hello", String.class).getBody();
    }
}
